<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddIsScrapToAkbusBusTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('akbus_bus', function (Blueprint $table) {
            //
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        if (Schema::hasColumn('akbus_bus', 'is_scrap')) {
        } else {
            Schema::table('akbus_bus', function (Blueprint $table) {
                $table->unsignedTinyInteger('is_scrap')
                ->default('0')
                ->comment('车辆报废状态 0 使用中 1 已报废');
            });
        }
    }
}
